<div class="row header">
	<div class="col-1 header-col">
		<?php if(!Mage::getSingleton('customer/session')->isLoggedIn()): ?>
			<span class="header-span-1">请登录!</span>
		<?php else : ?>
			<span class="header-span-1">欢迎,<?php echo Mage::getSingleton('customer/session')->getCustomer()->getName()?>!</span>
		<?php endif; ?>
		<ul class="header-span-2">
			<li><a href="/faq/">帮助中心</a></li>
			<li><a href="/wishlist/">我的收藏夹</a></li>
			<li><a href="/sales/order/history/">我的订单</a></li>
			<?php if(!Mage::getSingleton( 'customer/session' )->isLoggedIn()):?>
			<li><a href="/customer/account/login/">注册/登录</a></li>
			<?php else:?>
			<li><a href="/customer/account/logout/">退出登录</a></li>
			<li><a href="/customer/account/">商户中心</a></li>
			<li><a href="javascript:void();">送货区域:[<?php echo Mage::app()->getStore()->getName();?>]</a></li>
			<?php endif;?>
		</ul>
	</div>
	<div class="col-1 header-col" style="margin-top: 20px">
		<a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo">
			<img data-original="<?php echo $this->getSkinurl('images/logo.png')?>" src="<?php echo $this->getSkinurl('images/logo.png')?>">
		</a>
		<div class="row search">
			<div class="col-1">
				<?php $catalogSearchHelper =  $this->helper('catalogsearch'); ?>
				<div class="header-search">
					<form id="search_mini_form" action="<?php echo $catalogSearchHelper->getResultUrl() ?>" method="get">
						<input id="search" type="text" name="<?php echo $catalogSearchHelper->getQueryParamName() ?>" value="<?php echo $catalogSearchHelper->getEscapedQueryText() ?>" class="input-text" maxlength="<?php echo $catalogSearchHelper->getMaxQueryLength();?>" />
	        			<button type="submit" title="<?php echo Mage::helper('core')->quoteEscape($this->__('搜索')) ?>" class="button header-search-button"><span><span><?php echo $this->__('搜索') ?></span></span></button>
					</form>
						<script type="text/javascript">
				        //<![CDATA[
				            // var searchForm = new Varien.searchForm('search_mini_form', 'search', '<?php echo Mage::helper('core')->jsQuoteEscape($this->__('搜索')) ?>');
				            // searchForm.initAutocomplete('<?php echo $catalogSearchHelper->getSuggestUrl() ?>', 'search_autocomplete');
				        //]]>
				        </script>
				</div>
			</div>
			<div class="col-1">
				<div class="header-hot">
					<?php 
						$terms = Mage::getResourceModel('catalogsearch/query_collection')
				            ->setPopularQueryFilter(Mage::app()->getStore()->getId())
				            ->setPageSize(100)
				            ->load()
				            ->getItems();
					?>
					<dl>
						<dt>热门:</dt>
						<?php if($terms): ?>
							<?php $i=0; $num=6; foreach($terms as $term): ?>
								<?php 
									$hotSrachWords = $this->escapeHtml($term->getName());
									$sraechUrl     = Mage::getBaseurl() . "catalogsearch/result/?q={$hotSrachWords}";
								?>
								<?php if($i<$num): $i++;?>
								<dd>
									<a href="<?php echo $sraechUrl;?>">
										<?php echo $hotSrachWords ?>
									</a>
									<span>|</span>
								</dd>
								<?php endif; ?>
							<?php endforeach; ?>
						<?php else : ?>
							<dd>
								目前没有热门搜索词条...
							</dd>
						<?php endif; ?>
					</dl>
				</div>
			</div>
		</div>

		<div class="header-right-tip">
			<?php if(Mage::app()->getStore()->getConfig('checkout/sidebar/display')): ?>
				<?php 
					$Qty = 0;
					if(Mage::getSingleton('checkout/cart')->getSummaryQty())
					{
						$Qty = Mage::getModel('checkout/cart')->getSummaryQty();
					}
				?>
					<a class="header-mycart icon-cart" href="<?php echo $this->getUrl('checkout/cart');?>">
						我的购物车&nbsp;&nbsp;
						<i class="icon-cartqty"><?php echo intval($Qty) ?></i>
						<i class="icon-angle-right"></i>
					</a>
			<?php endif; ?>
			<a class="header-downphone icon-phone">下载手机客户端&nbsp;&nbsp;<i class="icon-angle-right"></i></a>
			<div class="anzhou-download-image" style="display: none;">
				<img src="<?php echo $this->getSkinurl('images/anzhuo.jpg')?>">
			</div>
		</div>
	</div>
</div>

<!-- Left NavaGtion -->
<div class="row">
	<div class="col-1 nav-container">
		<ul>
			<?php echo $this->getChildHtml('topMenu') ?>
			<?php 
				$routeName = Mage::app()->getRequest()->getRouteName();
				$identifier = Mage::getSingleton('cms/page')->getIdentifier();
				$currenturl = Mage::helper('core/url')->getCurrentUrl();
			 ?>
			<?php if($routeName == 'cms' && $identifier == 'home'): ?>
			<li class="active">
			<?php else : ?>
			<li>
			<?php endif; ?>
					<a href="/">首页</a>
					<p class="nav-bottom-mark"></p>
			</li>
			<?php if(strstr($currenturl, "/admin_zgb/recent/")): ?>
			<li class="active">
			<?php else : ?>
			<li>
			<?php endif; ?>
				<a href="/index.php/admin_zgb/recent/index/">最近购买</a>
				<p class="nav-bottom-mark"></p>
			</li>
			<li><a href="/customer/account/">商户中心</a><p class="nav-bottom-mark"></p></li>
		</ul>
	</div>
</div>
